<%@ page language="java" isELIgnored="false"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="/admin/public/bootstrap.min.css" title="" rel="stylesheet" />
<!-- 时间控件样式 -->
<link
	href="/admin/css/plugins/datetimepicker/bootstrap-datetimepicker.min.css"
	rel="stylesheet" media="screen" />
<link rel="stylesheet" href="/admin/css/plugins/toastr/toastr.min.css" />
<link href="/admin/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
<link href="/admin/public/animate.css" rel="stylesheet" />
<link rel="stylesheet" href="/admin/public/inspinia.css" />
<link rel="stylesheet" href="/admin/css/templet_form.css" />
<link rel="stylesheet" type="text/css"
	href="${request.getContext }/admin/css/xcConfirm.css" />
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
	<script src="/admin/public/html5shiv.min.js"></script>
	<script src="/admin/public/respond.min.js"></script>
<![endif]-->
<style>
th.prev {
	background: url(../img/dateleft.png) -3px !important;
}

th.next {
	background: url(../img/dateright.png) -10px !important;
}
</style>
<title>信息管理系统</title>

</head>
<body>
	<div id="wrapper" class="container">
		<div id="list" class="wrapper wrapper-content animated fadeInRight">
			<h3>数据字典配置</h3>
			<div class="right_box">
				<button type="button" onclick="addBcontract();"
					class="btn btn-success">新增</button>

				<!--表格部分-->
				<div class="ibox-content" style="margin-top: 20px;">
					<div class="row">
						<div class="col-sm-12">
							<table
								class="table table-striped table-bordered table-hover dataTables-example">
								<thead>
									<tr>
										<th width="11%">ID</th>
										<th width="12%">名称</th>
										<th width="7%">描述</th>
										<th width="11%">操作</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${list }" var="dictionary">
										<tr>
											<td>${dictionary.dictionaryId}</td>
											<td>${dictionary.dictionaryName}</td>
											<td>${dictionary.dictionaryDescription}</td>
											<td><a
												href="showDictInfo?dictId=${dictionary.dictionaryId}">数字字典项管理</a>
												<a href="updateDict?dictId=${dictionary.dictionaryId}">修改</a>
												<a onclick="Deletes('${dictionary.dictionaryId}')">删除</a></td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>
					</div>
					<form action="list" id="for" name="for" method="post">
						<input type="hidden" name="yehao" id="yin" value="1"> <input
							type="hidden" name="pagesize" id="tiaoshu"
							value="${page.pageSize }">
								<div class="fy">
									<span style="float: left;">每页条数：</span> <select
										style="width: 70px; float: left;"
										onchange="changeItem(this.value)" id="pagesize"
										name="pageSize">
										<option value="10" ${page.pageSize==10?'selected':'' }>10</option>
										<option value="20" ${page.pageSize==20?'selected':'' }>20</option>
										<option value="50" ${page.pageSize==50?'selected':'' }>50</option>
										<option value="100" ${page.pageSize==100?'selected':'' }>100</option>
										<option value="200" ${page.pageSize==200?'selected':'' }>200</option>
									</select>
									<div style="height: 27px;" class="col-sm-7">
										<div class="dataTables_paginate paging_simple_numbers"
											id="editable_paginate">
											<ul class="pagination pull-right" style="margin: -3px 0;">
												<li class="paginate_button previous" id="editable_previous">
													<a href="javascript:han(${page.pageNow-1 })"
													aria-controls="editable" data-dt-idx="0" tabindex="0">上一页</a>
												</li>
												<li class="paginate_button previous" id="editable_previous">
													<a href="#" aria-controls="editable" style="border: 0"
													data-dt-idx="0" tabindex="1"><input type="text"
														id="current"
														style="width: 32px; height: 19px; text-align: center;"
														value="${page.pageNow }" /> / ${zong }</a>
												</li>
												<li class="paginate_button previous" id="editable_previous">
													<a href="javascript:han(${page.pageNow+1 })"
													aria-controls="editable" data-dt-idx="0" tabindex="5">下一页</a>
													<a href="javascript:han($('#current').val())"
													aria-controls="editable" data-dt-idx="0" tabindex="5">跳转</a>
												</li>
											</ul>
										</div>
										<div style="position: fixed; right: 1%">总共${page.totalCount }条</div>
									</div>
								</div>
					</form>
				</div>
			</div>
			<!--</div>-->
		</div>
		<script src="../public/jquery-1.11.3.js"></script>
		<script src="../public/bootstrap.min.js" type="text/javascript"></script>
		<script src="../js/plugins/lhgdialog/lhgdialog.js"></script>
		<!-- 弹出警示框 -->
		<script src="../js/plugins/toastr/toastr.min.js"></script>
		<script src="../js/new_page.js"></script>
		<!-- 弹出确认框 -->
		<script src="../public/artDialog4.1.7/artDialog.js?skin=blue"></script>
		<script src="../public/artDialog4.1.7/plugins/iframeTools.js"></script>
		<!-- 时间控件样式 -->
		<script
			src="../js/plugins/datetimepicker/bootstrap-datetimepicker.min.js"></script>
		<script
			src="../js/plugins/datetimepicker/bootstrap-datetimepicker-update.min.js"></script>
		<script
			src="../js/plugins/datetimepicker/bootstrap-datetimepicker.zh-CN.js"></script>
		<script src="${request.getContext }/admin/js/xcConfirm.js"
			type="text/javascript" charset="utf-8"></script>
		<script
			src="${request.getContext }/admin/js/plugins/lhgdialog/lhgdialog.js"></script>
		<script src="../js/templet_form.js"></script>
		<script>
			function han(pn) {
				document.getElementById("yin").value = pn;
				var biao = document.getElementById("for");
				biao.submit();
			}
			function changeItem(size) {
				document.getElementById("tiaoshu").value = size;
				var biao = document.getElementById("for");
				biao.submit();
			}
			//添加合同跳转
			function addBcontract() {
				$.ajax({
					type : "get",
					url : "addDict",
					success : function() {
						window.location.href = 'addDict';
					}
				});
			}
			$(document).ready(function() {
				$('.i-checks').iCheck({
					checkboxClass : 'icheckbox_square-green',
					radioClass : 'iradio_square-green',
				});
			});

			$(document)
					.click(
							function() {
								if ($('.top_right', window.parent.document)
										.hasClass('open')) {
									$('.top_right', window.parent.document)
											.removeClass('open');
								}
								if ($('.msg', window.parent.document).hasClass(
										'open')) {
									$('.msg', window.parent.document)
											.removeClass('open');
								}
							})

			//单个删除
			function Deletes(dicId) {
				window.wxc
						.xcConfirm(
								"确定要删除此信息吗？",
								window.wxc.xcConfirm.typeEnum.confirm,
								{
									onOk : function() {
										$
												.ajax({
													type : "get",
													url : "delDict",
													data : {
														"dictId" : dicId
													},
													datatype : "json",
													success : function(data) {
														window.wxc
																.xcConfirm(
																		data.msg,
																		window.wxc.xcConfirm.typeEnum.info,
																		{
																			onOk : function() {
																				window.location.href = "/admin/dictionary/list";
																			}
																		})
													},
													error : function(data) {
														alert("删除失败!");
													}
												});
									}
								})
			}
		</script>
</body>
</html>
